<?php

/**
 * 搜索内容model操作
 * @author  xiaobai
 * @date    2019-05-17
 */

namespace app\common\model;

use app\common\model\Common;

class Search extends Common
{
    protected $pk = 'id';

    /**
     * 保存搜索数据
     * @param string $search    搜索内容
     */
    public function saveSearchData($search = '')
    {
        $data = [
            'search_name' => $search,
            'ip'          => get_client_ip(),
            'create_time' => time(),
        ];

        @$this->save($data);
    }

}
